package com.sayimo.maker.commons.push.netty;

import com.sayimo.maker.commons.push.netty.msg.PushMsg;

import io.netty.channel.socket.SocketChannel;

/**
 * @Project: schoolmallapi
 * @ClassName: NettyPush
 * @Description: 
 * @author:	chenpy
 * @date:	2016年11月1日
 * @version 1.0.0
 */
public class NettyPush {

    /** 
      * @package com.sayimo.school.mall.push.netty
      * @author chenpy
      * @Title:  
      * @Description: 推送消息
      * @param 
      * @throws 
      * @return void
      * @date 2016年11月1日
      */ 
    public static void push(PushMsg pushMsg){
        SocketChannel channel = (SocketChannel) NettyContextChannelMap.get(pushMsg.getPhoneNum());
        if (channel != null) {
            channel.writeAndFlush(pushMsg);
        }
    }
}
